package com.zzb.dao.impl;

import com.zzb.dao.CompanyDao;
import com.zzb.entity.CompanyEntity;
import com.zzb.util.MyBatisUtils;

import java.util.List;

public class CompanyDaoImpl implements CompanyDao {
    @Override
    public CompanyEntity findByName(CompanyEntity companyEntity) {
        CompanyDao companyDao = MyBatisUtils.getMapper(CompanyDao.class);
        return companyDao.findByName(companyEntity);
    }

    @Override
    public int add(CompanyEntity companyEntity) {
        CompanyDao companyDao = MyBatisUtils.getMapper(CompanyDao.class);
        return companyDao.add(companyEntity);
    }

    @Override
    public int delete(CompanyEntity companyEntity) {
        CompanyDao companyDao = MyBatisUtils.getMapper(CompanyDao.class);
        return companyDao.delete(companyEntity);
    }

    @Override
    public CompanyEntity findById(CompanyEntity companyEntity) {
        CompanyDao companyDao = MyBatisUtils.getMapper(CompanyDao.class);
        return companyDao.findById(companyEntity);
    }

    @Override
    public List<CompanyEntity> findAll(CompanyEntity companyEntity) {
        CompanyDao companyDao = MyBatisUtils.getMapper(CompanyDao.class);
        return companyDao.findAll(companyEntity);
    }

    @Override
    public int update(CompanyEntity companyEntity) {
        CompanyDao companyDao = MyBatisUtils.getMapper(CompanyDao.class);
        return companyDao.update(companyEntity);
    }

    @Override
    public int count(CompanyEntity companyEntity) {
        CompanyDao companyDao = MyBatisUtils.getMapper(CompanyDao.class);
        return companyDao.count(companyEntity);
    }
}
